adblock-fast: bugfixes: status & TLD check with unbound
authorStan Grishin <[email protected]>
Tue, 5 Aug 2025 03:05:53 +0000 (03:05 +0000)
committerStan Grishin <[email protected]>
Tue, 5 Aug 2025 16:16:33 +0000 (09:16 -0700)
fixes: https://github.com/openwrt/packages/issues/27146
supercedes: https://github.com/openwrt/packages/pull/27159

Signed-off-by: Stan Grishin <[email protected]>
net/adblock-fast/Makefile
net/adblock-fast/files/etc/init.d/adblock-fast

index fb13da8a22adce41b85c51c4efea68c13067bd87..39ac1119280a1a020c425fc48dc61d6db8698ac2 100644 (file)
@@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=adblock-fast
 PKG_VERSION:=1.1.4
-PKG_RELEASE:=4
+PKG_RELEASE:=5
 PKG_MAINTAINER:=Stan Grishin <[email protected]>
 PKG_LICENSE:=AGPL-3.0-or-later
 
index e3e09a862cd43b6dd19842aedd5ae3a27bb20687..93045857638aad801094577b57a77f306a3f0f3f 100755 (executable)
@@ -459,7 +459,7 @@ json() {
                        'get')
                                case "$param" in
                                        'errors'|'warnings')
-                                               json_select "$param" >/dev/null 2>&1
+                                               json_select "$param" >/dev/null 2>&1 || return
                                                if [ -z "$value" ]; then
                                                        json_get_keys i
                                                else
@@ -1140,7 +1140,7 @@ resolver() {
                sanity)
                        [ -n "$sanity_check" ] || return 0
                        output_dns "Sanity check for $dns TLDs "
-                       if ! grep -q -v '\.' "$outputFile"; then
+                       if ! grep -qvE '\.|server:' "$outputFile"; then
                                output_ok
                        else
                                json add warning 'warningSanityCheckTLD' "$outputFile"
@@ -1985,7 +1985,7 @@ adb_check_tld() {
                output "No block-list ('$outputFile') found.\n"
                return 0
        fi
-       c="$(grep -c -v '\.' "$outputFile")"
+       c="$(grep -cvE '\.|server:' "$outputFile")"
        if [ "$c" -gt 0 ]; then
                if [ "$c" -eq 1 ]; then
                        output 1 "Found 1 match for TLD in '$outputFile'.\n"
@@ -1995,7 +1995,7 @@ adb_check_tld() {
                        output 2 "[PROC] Found $c matches for TLDs in '$outputFile'.\n"
                fi
                if [ "$c" -le 20 ]; then
-                       grep -v '\.' "$outputFile" | sed "$outputOutputFilter"
+                       grep -vE '\.|server:' "$outputFile" | sed "$outputOutputFilter"
                fi
        else
                output 1 "No TLD was found in current block-list ('$outputFile').\n"